package com.leon.learnenginespace.activiti;

import org.activiti.engine.delegate.DelegateTask;
import org.activiti.engine.delegate.TaskListener;

import java.util.List;

/**
 * @description: 监听器
 * @author: WT
 * @date: 2024/3/29 0:47
 * @Version 1.0
 **/
public class Listener implements TaskListener {
    //delegateTasK是当前任务的对象
    @Override
    public void notify(DelegateTask delegateTask) {
        //默认是create事件
        if ("创建申请".equals(delegateTask.getName()) &&
                "create".equals(delegateTask.getEventName())) {
            delegateTask.setAssignee("张三");
        }
    }
}